﻿using System.Net.Mail;
using System.Text;

namespace OpenPhotoAlbum.BusinessLogics.Email
{
    public class EmailHtmlMessageBuilder: IEmailMessageBuilder
    {
        private string _to;

        public EmailHtmlMessageBuilder(string to)
        {
            _to = to;
        }

        #region IEmailMessageBuilder Members

        public System.Net.Mail.MailMessage BuildMessage()
        {
            MailMessage msg = new MailMessage();
            msg.From = new MailAddress(EmailConfigReader.Instance.ReadFrom());
            msg.To.Add(new MailAddress(_to));
            msg.IsBodyHtml = true;
            msg.Priority = MailPriority.Normal;
            msg.SubjectEncoding = Encoding.UTF8;
            return msg;
        }

        #endregion
    }
}
